using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_TABLE.
    /// </summary>
    public class DM_TABLE
    {
              private string _ID;
      private string _Name;
      private string _AreaID;
      private string _Note;
      private Int16 _Status;
      private DateTime _Time1;
      private double _Price;
      private DateTime _Time2;
      private double _Price2;
      private DateTime _Time3;
      private double _Price3;
      private DateTime _Time4;
      private double _Price4;
      private DateTime _Time5;
      private double _Price5;
      private string _IDPOS;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetID; 
      public bool IsIDNullable   
      { 
	 get { return false;  } 
      }
      public string ID
      {
         get { return _ID; }
         set 
	    { 
 		 _ID = value;
		IsSetID = true;
 	    }
      }
    public bool IsSetName; 
    public bool IsNameNullable   
    { 
		get { return false;  } 
    }
    public string Name
    {
        get{ return _Name;  }
        set
		{
			_Name = value;
			IsSetName = true;
		}
    }
    public bool IsSetAreaID; 
    public bool IsAreaIDNullable   
    { 
		get { return false;  } 
    }
    public string AreaID
    {
        get{ return _AreaID;  }
        set
		{
			_AreaID = value;
			IsSetAreaID = true;
		}
    }
    public bool IsSetNote; 
    public bool IsNoteNullable   
    { 
		get { return false;  } 
    }
    public string Note
    {
        get{ return _Note;  }
        set
		{
			_Note = value;
			IsSetNote = true;
		}
    }
    public bool IsSetStatus; 
    public bool IsStatusNullable   
    { 
		get { return false;  } 
    }
    public Int16 Status
    {
        get{ return _Status;  }
        set
		{
			_Status = value;
			IsSetStatus = true;
		}
    }
    public bool IsSetTime1; 
    public bool IsTime1Nullable   
    { 
		get { return false;  } 
    }
    public DateTime Time1
    {
        get{ return _Time1;  }
        set
		{
			_Time1 = value;
			IsSetTime1 = true;
		}
    }
    public bool IsSetPrice; 
    public bool IsPriceNullable   
    { 
		get { return false;  } 
    }
    public double Price
    {
        get{ return _Price;  }
        set
		{
			_Price = value;
			IsSetPrice = true;
		}
    }
    public bool IsSetTime2; 
    public bool IsTime2Nullable   
    { 
		get { return false;  } 
    }
    public DateTime Time2
    {
        get{ return _Time2;  }
        set
		{
			_Time2 = value;
			IsSetTime2 = true;
		}
    }
    public bool IsSetPrice2; 
    public bool IsPrice2Nullable   
    { 
		get { return false;  } 
    }
    public double Price2
    {
        get{ return _Price2;  }
        set
		{
			_Price2 = value;
			IsSetPrice2 = true;
		}
    }
    public bool IsSetTime3; 
    public bool IsTime3Nullable   
    { 
		get { return false;  } 
    }
    public DateTime Time3
    {
        get{ return _Time3;  }
        set
		{
			_Time3 = value;
			IsSetTime3 = true;
		}
    }
    public bool IsSetPrice3; 
    public bool IsPrice3Nullable   
    { 
		get { return false;  } 
    }
    public double Price3
    {
        get{ return _Price3;  }
        set
		{
			_Price3 = value;
			IsSetPrice3 = true;
		}
    }
    public bool IsSetTime4; 
    public bool IsTime4Nullable   
    { 
		get { return false;  } 
    }
    public DateTime Time4
    {
        get{ return _Time4;  }
        set
		{
			_Time4 = value;
			IsSetTime4 = true;
		}
    }
    public bool IsSetPrice4; 
    public bool IsPrice4Nullable   
    { 
		get { return false;  } 
    }
    public double Price4
    {
        get{ return _Price4;  }
        set
		{
			_Price4 = value;
			IsSetPrice4 = true;
		}
    }
    public bool IsSetTime5; 
    public bool IsTime5Nullable   
    { 
		get { return false;  } 
    }
    public DateTime Time5
    {
        get{ return _Time5;  }
        set
		{
			_Time5 = value;
			IsSetTime5 = true;
		}
    }
    public bool IsSetPrice5; 
    public bool IsPrice5Nullable   
    { 
		get { return false;  } 
    }
    public double Price5
    {
        get{ return _Price5;  }
        set
		{
			_Price5 = value;
			IsSetPrice5 = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }

        #endregion

        #region Constructors
        public DM_TABLE()
        {
            Reset();
        }
        public DM_TABLE(DM_TABLE obj)
        {
            	this._ID = obj.ID;
	this._Name = obj.Name;
	this._AreaID = obj.AreaID;
	this._Note = obj.Note;
	this._Status = obj.Status;
	this._Time1 = obj.Time1;
	this._Price = obj.Price;
	this._Time2 = obj.Time2;
	this._Price2 = obj.Price2;
	this._Time3 = obj.Time3;
	this._Price3 = obj.Price3;
	this._Time4 = obj.Time4;
	this._Price4 = obj.Price4;
	this._Time5 = obj.Time5;
	this._Price5 = obj.Price5;
	this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
                     _ID = EmptyValues.v_string;
         _Name = EmptyValues.v_string;
         _AreaID = EmptyValues.v_string;
         _Note = EmptyValues.v_string;
         _Status = EmptyValues.v_Int16;
         _Time1 = EmptyValues.v_DateTime;
         _Price = EmptyValues.v_double;
         _Time2 = EmptyValues.v_DateTime;
         _Price2 = EmptyValues.v_double;
         _Time3 = EmptyValues.v_DateTime;
         _Price3 = EmptyValues.v_double;
         _Time4 = EmptyValues.v_DateTime;
         _Price4 = EmptyValues.v_double;
         _Time5 = EmptyValues.v_DateTime;
         _Price5 = EmptyValues.v_double;
         _IDPOS = EmptyValues.v_string;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (string)reader["ID"];
		}
                if(!(reader["Name"] is DBNull))
		{
			obj.Name = (string)reader["Name"];
		}
                if(!(reader["AreaID"] is DBNull))
		{
			obj.AreaID = (string)reader["AreaID"];
		}
                if(!(reader["Note"] is DBNull))
		{
			obj.Note = (string)reader["Note"];
		}
                if(!(reader["Status"] is DBNull))
		{
			obj.Status = (Int16)reader["Status"];
		}
                if(!(reader["Time1"] is DBNull))
		{
			obj.Time1 = (DateTime)reader["Time1"];
		}
                if(!(reader["Price"] is DBNull))
		{
			obj.Price = (double)reader["Price"];
		}
                if(!(reader["Time2"] is DBNull))
		{
			obj.Time2 = (DateTime)reader["Time2"];
		}
                if(!(reader["Price2"] is DBNull))
		{
			obj.Price2 = (double)reader["Price2"];
		}
                if(!(reader["Time3"] is DBNull))
		{
			obj.Time3 = (DateTime)reader["Time3"];
		}
                if(!(reader["Price3"] is DBNull))
		{
			obj.Price3 = (double)reader["Price3"];
		}
                if(!(reader["Time4"] is DBNull))
		{
			obj.Time4 = (DateTime)reader["Time4"];
		}
                if(!(reader["Price4"] is DBNull))
		{
			obj.Price4 = (double)reader["Price4"];
		}
                if(!(reader["Time5"] is DBNull))
		{
			obj.Time5 = (DateTime)reader["Time5"];
		}
                if(!(reader["Price5"] is DBNull))
		{
			obj.Price5 = (double)reader["Price5"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["ID"];
//            _Name = (reader["Name"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Name"];
//            _AreaID = (reader["AreaID"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["AreaID"];
//            _Note = (reader["Note"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["Note"];
//            _Status = (reader["Status"] is DBNull)?DalTools.EmptyValues.v_Int16:(Int16)reader["Status"];
//            _Time1 = (reader["Time1"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["Time1"];
//            _Price = (reader["Price"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["Price"];
//            _Time2 = (reader["Time2"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["Time2"];
//            _Price2 = (reader["Price2"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["Price2"];
//            _Time3 = (reader["Time3"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["Time3"];
//            _Price3 = (reader["Price3"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["Price3"];
//            _Time4 = (reader["Time4"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["Time4"];
//            _Price4 = (reader["Price4"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["Price4"];
//            _Time5 = (reader["Time5"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["Time5"];
//            _Price5 = (reader["Price5"] is DBNull)?DalTools.EmptyValues.v_double:(double)reader["Price5"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(string ID, string Name, string AreaID, string Note, Int16 Status, DateTime Time1, double Price, DateTime Time2, double Price2, DateTime Time3, double Price3, DateTime Time4, double Price4, DateTime Time5, double Price5, string IDPOS)
        {
                     this._ID = ID;
         this._Name = Name;
         this._AreaID = AreaID;
         this._Note = Note;
         this._Status = Status;
         this._Time1 = Time1;
         this._Price = Price;
         this._Time2 = Time2;
         this._Price2 = Price2;
         this._Time3 = Time3;
         this._Price3 = Price3;
         this._Time4 = Time4;
         this._Price4 = Price4;
         this._Time5 = Time5;
         this._Price5 = Price5;
         this._IDPOS = IDPOS;
        }
    }
}